
/* scroll to the anchor and scroll spy */
var navbarHeight = 55;
$("#page-scrollspy a.nav-link").on('click', function () {
    /* decode chinese hash */
    var target = decodeURI(this.hash.replace(/^#/, ''));
    $('html,body').animate({scrollTop: $(":header[id='" + target + "']").offset().top - navbarHeight}, 10);
    return false;
});

$('body').scrollspy({ target: "#page-scrollspy", offset: navbarHeight+5 });